<link rel="stylesheet" href="<?php echo base_url()?>assets/cake.generic.css" />
<link rel="stylesheet" href="<?php echo base_url()?>assets/style.css" />
<script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery-1.7.2min.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>assets/js/chat.js"></script>
	<div id="container">
		<div id="header">
			<div id="menus">
				<ul>
					<li><?php echo anchor('login/logout','Logout')?></li>
					<li><?php echo anchor('memo','Memo')?></li>
					<li><?php echo anchor('profile','Profile')?></li>
				</ul>
			</div>
		</div>       
       <div id="right-bar">
        	<div id="chat-panel">
                <div class="friend-panel" >
	                <ul>
			                      <li><div class="user-chat"><?php echo "Chat(".count($online).")";?></div></li>
						<?php foreach($online as $allOnline ): ?>
                                   <li><div class="user-chat" id="<?php echo $allOnline['user_id']?>" onclick="oChat(this.id);"><?php echo  $allOnline['firstname']; ?></div></li>
                         <?php endforeach;?>
                    </ul>   
                </div>			
            </div>
		</div>
		<div id="content">
<?php echo $this->session->userdata('email');?>
	<?php
    $memoV = null;
    $memoidV = null;
    if(isset($val)):
    $memoV = $val['memo'];
    $memoidV = $val['memo_id'];
    endif;
    echo form_open('memo/save');
    $Amemo = array('rows'=>5,'cols'=>32,'name'=>'Tmemo','value'=>$memoV);
    echo form_hidden('Huser_id',$this->session->userdata('user_id'));
    echo form_hidden('Hmemoid',$memoidV);
    echo form_textarea($Amemo);
    $Asubmit = array('name'=>'Bsubmit','value'=>'Post');
    echo form_submit($Asubmit);
    echo form_close();
    ?>
    <div class="chat-boxitem" style="display:none">
	    <div class="chat-message"></div>
    	<div class="chat-input"><?php echo form_input(array('name'=>'chat','class'=>'chat-box-input'))?></div>
    </div>
    <div id="memo-area">
        <?php	
        foreach($memo as $memos):?>	
            <div class="memo-block">	
                <div class="memo-content">
                <?php echo $memos['memo']; ?>
                </div>
                <div class="action-memo">
                <?php echo date('d M Y',strtotime($memos['tanggal']))?>
                <?php echo anchor('memo/index/'.$memos['memo_id'],'Edit')?> ||
                <?php echo anchor('memo/del/'.$memos['memo_id'],'Delete')?>
                </div>
            </div>
        <?php endforeach; ?>
        </div>		
	</div>

		<div id="footer"></div>
 
	</div>
